package day13;

/**
 * 线程的sleep方法，多个线程内调用相互不影响
 */
public class SleepDemo {

    public static void main(String[] args) {
        System.out.println("开始");
        new Thread(() -> {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("子线程");
        }).start();
        System.out.println("主线程");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("结束");
    }

}
